<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .box1{
            width: 200px;
            height: 200px;
            background-color: yellow;
            position: absolute;
            top: 100px;
            left: 100px;
            
        }
        .fa{
            width: 500px;
            height: 500px;
            background: yellow;
            margin: 0 auto;
            position: relative;
        }
        .ch{
            width: 200px;
            height: 200px;
            background: red;
            position: absolute;
            left: 100px;
            top: 100px;
        }
    </style>
</head>
<body>
    <!-- <div>22222222</div>
    <div class="box1"></div> -->

    <!-- 有父元素 -->
    <div class="fa">
        <div class="ch"></div>
    </div>
</body>
</html>